import typescript from '@rollup/plugin-typescript';
import vuePlugin from 'rollup-plugin-vue';
import scss from 'rollup-plugin-scss';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import esbuild from 'rollup-plugin-esbuild';
import terser from '@rollup/plugin-terser';
export default {
    input: {
        index: 'src/index.ts',
        icons: 'src/icons.ts'
    },
    output: {
        dir: 'dist',                     
        format: 'esm',
        entryFileNames: '[name].js',     
        assetFileNames: '[name][extname]'
    },
    plugins: [
        resolve({
            extensions: ['.js', '.ts', '.vue']
        }),
        vuePlugin({
            target: 'browser',
            preprocessStyles: false
        }),
        esbuild({
            target: 'esnext',
            include: /\.[jt]sx?$/,
            exclude: /node_modules/,
            sourceMap: false,
            minify: false,
            loaders: {
                '.vue': 'ts'
            }
        }),
        commonjs(), 
        scss({
            name: 'index.css',
            filename: 'index.css'
        }),
        terser(),
        typescript({
            tsconfig: './tsconfig.json',
            declaration: true,
            declarationDir: './dist'
        })
    ]
}